<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller {
	function __construct()
	{
		parent::__construct();
	}

	function index()
	{
		$this -> load -> helper(array('form'));
		$session_data = $this -> session -> userdata('logged_in');
		$data['username'] = $session_data['username'];
		$data['kode_privilege'] = $session_data['kode_privilege'];
		$data['contents'] = $this -> load -> view('login_view','',true);
		$data['page_title'] = 'Login';
		$this -> load -> view('template_default',$data);
	}

	function logout()
	{
		$this -> session -> unset_userdata('logged_in');
		$this -> session -> sess_destroy();
		redirect('login', 'refresh');
	}
}
?>
